unify(common): Merge Registry code#2193
Merged
xezon merged 1 commit intoTheSuperHackers:mainfrom Jan 27, 2026
Merged
Conversation
Greptile Overview
|
| Filename | Overview |
|---|---|
| Generals/Code/GameEngine/Include/Common/Registry.h | Added declaration for GetStringFromGeneralsRegistry function to support cross-version registry access |
| Generals/Code/GameEngine/Source/Common/System/registry.cpp | Unified registry code with RTS_GENERALS/RTS_ZEROHOUR preprocessor directives and added GetStringFromGeneralsRegistry implementation |
| GeneralsMD/Code/GameEngine/Source/Common/System/registry.cpp | Added RTS_GENERALS/RTS_ZEROHOUR preprocessor directives to unify registry path handling across game versions |
Sequence Diagram
sequenceDiagram
participant App as Application Code
participant API as Registry API
participant Helper as Helper Functions
participant WinReg as Windows Registry
Note over App,WinReg: Registry Read Flow
App->>API: GetStringFromRegistry(path, key, val)
API->>API: Determine registry path based on RTS_GENERALS/RTS_ZEROHOUR
API->>Helper: getStringFromRegistry(HKEY_LOCAL_MACHINE, fullPath, key, val)
Helper->>WinReg: RegOpenKeyEx(HKEY_LOCAL_MACHINE, ...)
alt Key Found
Helper->>WinReg: RegQueryValueEx(...)
WinReg-->>Helper: Return value
Helper-->>API: Return TRUE
API-->>App: Return TRUE with value
else Key Not Found
Helper-->>API: Return FALSE
API->>Helper: getStringFromRegistry(HKEY_CURRENT_USER, fullPath, key, val)
Helper->>WinReg: RegOpenKeyEx(HKEY_CURRENT_USER, ...)
alt Key Found
Helper->>WinReg: RegQueryValueEx(...)
WinReg-->>Helper: Return value
Helper-->>API: Return TRUE
API-->>App: Return TRUE with value
else Key Not Found
Helper-->>API: Return FALSE
API-->>App: Return FALSE
end
end
Note over App,WinReg: Cross-Version Access
App->>API: GetStringFromGeneralsRegistry(path, key, val)
Note over API: Always uses Generals registry path
API->>Helper: getStringFromRegistry(HKEY_LOCAL_MACHINE, "...\\Generals"+path, key, val)
Helper->>WinReg: RegOpenKeyEx(...)
alt Key Found in HKLM
WinReg-->>Helper: Return value
Helper-->>API: Return TRUE
API-->>App: Return TRUE with value
else Try HKCU
API->>Helper: getStringFromRegistry(HKEY_CURRENT_USER, "...\\Generals"+path, key, val)
Helper->>WinReg: RegOpenKeyEx(...)
WinReg-->>Helper: Return value or error
Helper-->>API: Return TRUE/FALSE
API-->>App: Return TRUE/FALSE
end
Skyaero42
reviewed
Jan 27, 2026
Skyaero42
reviewed
Jan 27, 2026
2433256 to
c951a59
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change merges the Registry code in GameEngine.